<template>
  <ul class="meeting-operation-view">

    <li class="meeting-item" v-for="item in datas" :key="item.id">
      <div class="item-top">
        <div class="grid-content">
          <el-tag style="margin-right: 10px;">
            <span v-if="item.Type==='Resolution'">决议会议</span>
            <span v-else-if="item.Type==='Ordinary'">普通会议</span>
          </el-tag>
          <el-tag style="margin-right: 10px;" v-if="item.ResolutionBusiness==='ProjectResolution'">
            <span>立项决议</span>
          </el-tag>
          <el-tag style="margin-right: 10px;" v-else-if="item.ResolutionBusiness==='SchemeReview'">
            <span>方案评审</span>
          </el-tag>
          <el-tag style="margin-right: 10px;" v-else-if="item.ResolutionBusiness==='PlanReview'">
            <span>计划评审</span>
          </el-tag>
          <el-tag style="margin-right: 10px;" v-else-if="item.ResolutionBusiness==='TaskAcceptance'">
            <span>任务验收</span>
          </el-tag>
          <el-tag style="margin-right: 10px;" v-else-if="item.ResolutionBusiness==='ProjectAcceptance'">
            <span>项目验收</span>
          </el-tag>
          <el-tag style="margin-right: 10px;" v-else-if="item.ResolutionBusiness==='PeriodicReview'">
            <span>阶段性评审</span>
          </el-tag>
          <span>{{ item.Name }}</span>
        </div>
        <div class="grid-content item-time">{{ item.Creator.Name }}</div>
        <el-button class="detail-btn" type="text" size="medium" @click="toMeetingDetail(item)">详情</el-button>
      </div>
      <div class="item-bootom">
        <div class="grid-content item-time">{{ dateFormat1('yyyy-mm-dd HH:MM:SS', item.CreatedAt) }}</div>
        <div class="grid-content item-address">{{formatterState(item)}}</div>
        <div v-if="item.MeetingSummary">{{item.MeetingSummary.Conclusion}}</div>
        <!--        <div class="grid-content item-address" v-if="item.MeetingSummary && item.MeetingSummary.Conclusion">{{ item.MeetingSummary.Conclusion }}</div>-->
      </div>
    </li>

  </ul>
</template>

<script>
    export default {
        name: "meetingView",
        props:{
            datas:Array
        },
        methods:{
            toMeetingDetail:function (item) {
                this.$comFun.goMeetingView(item.Id)
            },
            formatterState(row) {
                if (row.State == 'ToDo') {
                    return '未开始'

                }
                if (row.State == 'Doing') {
                    return '进行中'
                }
                if (row.State == 'Done') {
                    return '已结束'

                }
                if (row.State == 'Cancel') {
                    return '已取消'
                }
            },
        }
    }
</script>

<style lang="scss" scoped>
  @import "@/styles/variables.scss";
  .meeting-operation-view{
    padding: 0;
    margin: 0;
    .meeting-item{
      margin-bottom: $collection-y;
    }
    .item-top{
      display: flex;
      justify-content: flex-start;
      align-items: center;
      margin-bottom: $block-space-y;
      .item-time{
        margin-left: 40px;
        color: $font-color-info;
      }
      .detail-btn{
        margin-left: 40px;
      }
    }
    .item-bootom{
      display: flex;
      align-items: center;
      .item-address{
        margin: 0 $block-x;
      }
    }
    .grid-content{
      font-size: $font-size-main;
      color: $font-color-main;
      line-height: 24px;
    }
  }

</style>
